package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.system.domain.Complaint;
import com.ruoyi.system.mapper.ComplaintMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ComplaintchuliMapper;
import com.ruoyi.system.domain.Complaintchuli;
import com.ruoyi.system.service.IComplaintchuliService;
import com.ruoyi.common.support.Convert;

/**
 * 客户投诉处理 服务层实现
 * 
 * @author ruoyi
 * @date 2019-07-16
 */
@Service
public class ComplaintchuliServiceImpl implements IComplaintchuliService 
{
	@Autowired
	private ComplaintchuliMapper complaintchuliMapper;
	@Autowired
	private ComplaintMapper complaintMapper;

	/**
     * 查询客户投诉处理信息
     * 
     * @param complaintchuliId 客户投诉处理ID
     * @return 客户投诉处理信息
     */
    @Override
	public Complaintchuli selectComplaintchuliById(Integer complaintchuliId)
	{
	    return complaintchuliMapper.selectComplaintchuliById(complaintchuliId);
	}
	
	/**
     * 查询客户投诉处理列表
     * 
     * @param complaintchuli 客户投诉处理信息
     * @return 客户投诉处理集合
     */
	@Override
	public List<Complaintchuli> selectComplaintchuliList(Complaintchuli complaintchuli)
	{
	    return complaintchuliMapper.selectComplaintchuliList(complaintchuli);
	}
	
    /**
     * 新增客户投诉处理
     * 
     * @param complaintchuli 客户投诉处理信息
     * @return 结果
     */
	@Override
	public int insertComplaintchuli(Complaintchuli complaintchuli)
	{
/*		Complaint complaint = complaintMapper.selectComplaintById(complaintchuli.getComplaintId());
		complaint.setChuliJindu(complaintchuli.getChuliJieGuo());
		int a = complaintMapper.updateComplaint(complaint);*/
	    return complaintchuliMapper.insertComplaintchuli(complaintchuli);
	}
	
	/**
     * 修改客户投诉处理
     * 
     * @param complaintchuli 客户投诉处理信息
     * @return 结果
     */
	@Override
	public int updateComplaintchuli(Complaintchuli complaintchuli)
	{
	    return complaintchuliMapper.updateComplaintchuli(complaintchuli);
	}

	/**
     * 删除客户投诉处理对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteComplaintchuliByIds(String ids)
	{
		return complaintchuliMapper.deleteComplaintchuliByIds(Convert.toStrArray(ids));
	}
	
}
